<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <title>home</title>
</head>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<body>

<div class="tools">
    <form action="/map" method="post">
        <input name="name"/>
        <input name="password"/>
        <input type="submit" value="submit"/>
    </form>
</div>


<div class="tools">
    <input id="ajValue" name="value"/>
    <input type="button" onclick="addCookie()" value="submit"/>
</div>

<div class="tools">
    <input type="button" onclick="getCookie()" value="submit"/>
</div>

</body>
<script>
    function getCookie() {
        $.ajax({
            url: '/getCookie',
            success: function (data) {
                alert(data);
            }
        })
    }

    function addCookie() {
        var value = $("#ajValue").val();
        $.ajax({
            url: '/addCookie',
            data: {'value': value},
            success: function (data) {
                alert(data);
            }
        })
    }
</script>
</html>